<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVersionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('versions', function (Blueprint $table) {
            $table->id();
            $table->string('version', 20)->default('')->comment('版本号');
            $table->unsignedInteger('version_num')->default(1)->comment('版本号数字');
            $table->enum('type', ['android', 'ios'])->comment('类型');
            $table->string('path', 255)->default('')->comment('下载地址');
            $table->text('explain')->comment('说明');
            $table->boolean('force')->default(false)->comment('强制更新');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('versions');
    }
}
